﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KLadderProposal.Interfaces.BasicStructures
{
    public class GraphNode : IEquatable<GraphNode>
    {
        public int SequenceNumber { get; set; }
        public string Label { get; set; }
        public int ClusterNumber { get; set; }

        public int TempClusterNumber { get; set; }

        private List<int> _clusterNumbers = new List<int>();
        public List<int> ClusterNumbers 
        {
            get
            {
                if (_clusterNumbers.Count == 0)
                    _clusterNumbers.Add(0);

                return _clusterNumbers;
            }
            set 
            {
                _clusterNumbers = value;
            }
        }

        public bool IsMarkedAsDeleted { get; set; }

        public bool IsVisited { get; set; }

        private SortedList<string, GraphNode> _neighbors = null;
        public SortedList<string, GraphNode> Neighbors
        {
            get
            {
                if (_neighbors == null)
                    _neighbors = new SortedList<string, GraphNode>();

                return _neighbors;
            }
        }

        public decimal ThreeCliqueNumber { get; set; }

        public override string ToString()
        {
            return Label;
        }

        public bool Equals(GraphNode other)
        {
            return other.Label.Equals(Label);
        }

        public int Level
        {
            get;
            set;
        }
    }
}

